/*++
Module Name:

    Driver.h

Abstract:

    This module contains the type definitions for the Sensor Skeleton sample's
    driver callback class.
--*/

#pragma once

//
// This class handles driver events.  In particular
// it supports the OnDeviceAdd event, which occurs when the driver is called
// to setup per-device handlers for a new device stack.
//

class ATL_NO_VTABLE CWP7AccelerometerDriver :
    public CComObjectRootEx<CComMultiThreadModel>,
    public CComCoClass<CWP7AccelerometerDriver, &CLSID_WP7AccelerometerSensorDriver>,
    public IDriverEntry
{
public:
    CWP7AccelerometerDriver();

    DECLARE_NO_REGISTRY()
    DECLARE_CLASSFACTORY()
    DECLARE_NOT_AGGREGATABLE(CWP7AccelerometerDriver)

    BEGIN_COM_MAP(CWP7AccelerometerDriver)
        COM_INTERFACE_ENTRY(IDriverEntry)
    END_COM_MAP()

public:
    //
    // IDriverEntry
    //
    STDMETHOD  (OnInitialize)(__in IWDFDriver* pDriver);
    STDMETHOD  (OnDeviceAdd)(__in IWDFDriver* pDriver, __in IWDFDeviceInitialize* pDeviceInit);
    STDMETHOD_ (void, OnDeinitialize)(__in IWDFDriver* pDriver);
};

OBJECT_ENTRY_AUTO(__uuidof(WP7AccelerometerSensorDriver), CWP7AccelerometerDriver)

